﻿<%@ Page Language="C#" MasterPageFile="~/Org/MasterPage.master" CodeFile="frmO_EmpWorkedCompInput.aspx.cs"
    Culture="ja-JP" UICulture="ja" ValidateRequest="false" AutoEventWireup="true" EnableEventValidation="false" 
    Inherits="Org_frmO_EmpWorkedCompInput" Title="職歴情報登録" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    職歴情報登録
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">


        <script src="../js/jquery.min.js" type="text/javascript"></script>
        <script src="../js/Validation.js" type="text/javascript"></script>
        <script type="text/javascript" language="javascript" src="../js/jquery.maskedinput.js"></script>
        <script type="text/javascript" language="javascript" src="../js/Validation.js"></script>

        <script type="text/javascript">

            function CompareDate(src, args) {
                var date_start = $("#<%= txt_開始年月日.ClientID %>").val();
                args.IsValid = checkYearOld(date_start, args.Value, 0, "<");
            }

            function Check2IsValid(source, args) {
                if (args.Value != "") {
                    ValidatorEnable2(document.getElementById("<%= CustomValidator1.ClientID %>"), true);
                }
            }

            // kiem tra ngay bat dau lam viec phai lon hon ngay sinh cua nhan vien
            function checkGreaterBirthday(src, args) {
                var dateStart = $('#<%= hfNgaySinh.ClientID %>').val();
                if (dateStart != "") {
                    args.IsValid = checkYearOld(dateStart, args.Value, 0, "<");
                }
            }
            
            $(document).ready(function() {

                registerEnterEvent("enter", "<%= btn登録.ClientID %>", 6);
                registerControlToValidation("validation");
                formatDate("css_text_calender", "/");

            });

            
        </script>


    <div class="maindiv1">
    <link href="../Style/Style.css" rel="stylesheet" type="text/css" />
        <div class="Header1">
            <span>＊: 必須</span>
        </div>
        <div class="NoteStyle">
            
            <span>※下記の情報があれば、必須項目を入力してください。なければ、次ボタンを押してください。 </span>
        </div>
        <div>
            &nbsp;</div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">会社名 :</span>
            <asp:TextBox ID="txt_会社名" runat="server" Style="ime-mode: active"  Font-Names="MS UI Gothic"
                MaxLength="100" ValidationGroup="detailform" CssClass="enter validation textbox width2"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_会社名"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" Width="260px"
                TargetControlID="RequiredFieldValidator1" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">部門名 :</span>
            <asp:TextBox ID="txt_部門名" runat="server" Style="ime-mode: active"  Font-Names="MS UI Gothic"
                MaxLength="100" ValidationGroup="detailform" CssClass="enter validation textbox width2"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_部門名"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" Width="260px"
                TargetControlID="RequiredFieldValidator2" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">仕事内容 :</span>
            <asp:TextBox ID="txt_仕事内容" runat="server"  Font-Names="MS UI Gothic"
                MaxLength="1000" ValidationGroup="detailform" Style="ime-mode: active" CssClass="enter validation textbox width2"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_仕事内容"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" Width="260px"
                TargetControlID="RequiredFieldValidator3" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">主な実績 :</span>
            <asp:TextBox ID="txt_主な実績" runat="server" Style="ime-mode: active" 
                Font-Names="MS UI Gothic" MaxLength="500" ValidationGroup="detailform" CssClass="enter validation textbox width2"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_主な実績"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" Width="260px"
                TargetControlID="RequiredFieldValidator4" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">開始年月日 :</span>
            <asp:TextBox ID="txt_開始年月日" runat="server" onkeypress="return InputNumberKeys(this, event)"
                 Font-Names="MS UI Gothic" ValidationGroup="detailform" Style="ime-mode: disabled"
                CausesValidation="True" CssClass="enter css_text_calender validation textbox width_calendar"></asp:TextBox>
            <asp:ImageButton ID="ImageButton11" runat="server" CssClass="cal_Imgl" Height="16px"
                ImageUrl="../Images/calendar.jpg" CausesValidation="False" ValidationGroup="detailform" />
            <ajaxToolkit:CalendarExtender ID="CalendarExtender12" runat="server" TargetControlID="txt_開始年月日"
                PopupButtonID="ImageButton11" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            
            <asp:CustomValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="CustomValidator"
                ControlToValidate="txt_開始年月日" Display="None" SetFocusOnError="false" ClientValidationFunction="isDate"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" Width="240px"
                TargetControlID="RegularExpressionValidator1" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="CustomValidator"
                ControlToValidate="txt_開始年月日" Display="None" SetFocusOnError="false" ClientValidationFunction="Check2IsValid"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="server" Width="260px"
                TargetControlID="CustomValidator2" HighlightCssClass="invalid3" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            
            <asp:CustomValidator ID="CustomValidator3" runat="server" ErrorMessage="CustomValidator"
                ControlToValidate="txt_開始年月日" Display="None" SetFocusOnError="false" ClientValidationFunction="checkGreaterBirthday"></asp:CustomValidator>
            
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender10" runat="server" Width="260px"
                TargetControlID="CustomValidator3" HighlightCssClass="invalid4" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
                </ajaxToolkit:ValidatorCalloutExtender>    
                
            
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">終了年月日 :</span>
            <asp:TextBox ID="txt_終了年月日" runat="server" onkeypress="return InputNumberKeys(this, event)"
                 Font-Names="MS UI Gothic" ValidationGroup="detailform" Style="ime-mode: disabled"
                CausesValidation="True" CssClass="enter validation css_text_calender textbox width_calendar"></asp:TextBox>
            <asp:ImageButton ID="ImageButton12" runat="server" CssClass="cal_Img" Height="16px"
                ImageUrl="../Images/calendar.jpg" CausesValidation="False" ValidationGroup="detailform" /><span
                    class="required-field"> *</span>
            <ajaxToolkit:CalendarExtender ID="CalenderExtender11" runat="server" TargetControlID="txt_終了年月日"
                PopupButtonID="ImageButton12" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" Display="None"
                ErrorMessage="" ControlToValidate="txt_終了年月日"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" Width="260px"
                TargetControlID="RequiredFieldValidator5" HighlightCssClass="invalid1" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Compare"
                Display="None" SetFocusOnError="False" ControlToValidate="txt_終了年月日" ClientValidationFunction="CompareDate"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender8" Width="260px"
                TargetControlID="CustomValidator1" HighlightCssClass="invalid2" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="CustomValidator"
                ControlToValidate="txt_終了年月日" Display="None" SetFocusOnError="false" ClientValidationFunction="isDate"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server" Width="240px"
                TargetControlID="RegularExpressionValidator2" HighlightCssClass="invalid3" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            
        </div>
        <br />
        <div class="detail-admin-row">
            <span class="detail-admin-label">&nbsp;</span>
            <asp:Button ID="btn登録" runat="server" Text="登録" CssClass="btn" OnClientClick="javascript:focusToControlErr();"
                OnClick="btn登録_Click" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnリセット" runat="server" Text="リセット" CssClass="btn" OnClick="btnリセット_Click"
                CausesValidation="False" />
        </div>
        <div class="headerLineAndGray">
            ＊会社履歴情報一覧</div>
        <asp:HiddenField ID="hd_pageCount" runat="server"></asp:HiddenField>
        <div style="margin: 10px 50px 50px" class="detail-admin-row">
            
            <%--<asp:Panel ID="Panel1" runat="server" ScrollBars="Auto">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>--%>
                        <asp:GridView CssClass="mGrid" ID="grv_human" runat="server" Width="100%" GridLines="Horizontal"
                            Height="40px" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" DataKeyNames="ID"
                            AutoGenerateColumns="false" AllowPaging="true" PageSize="10" OnPageIndexChanging="grv_human_PageIndexChanging"
                            Font-Names="MS UI Gothic" onprerender="grv_human_PreRender" 
                            onrowcommand="grv_human_RowCommand" onrowdatabound="grv_human_RowDataBound">
                            <Columns>
                                <asp:TemplateField HeaderText="会社名" ItemStyle-Width="200px" ItemStyle-Wrap="true">
                                    <ItemTemplate>
                                        <div style="width: 200px; white-space: normal; overflow: hidden">
                                            <asp:Label ID="Label1" runat="server" ToolTip='<%#  Eval("会社名")%>' Height="100%"><%# ShowTextLength(Eval("会社名"))%></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="部門名">
                                    <ItemStyle HorizontalAlign="Left" Width="200px" />
                                    <ItemTemplate>
                                        <div style="width: 200px; white-space: normal; overflow: hidden">
                                            <asp:Label ID="Label1" runat="server" ToolTip='<%# Eval("部門名")%>'>  <%#  ShowTextLength(Eval("部門名")) %> </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="開始年月日" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_開始年月日" runat="server" Text='<%# Eval("開始年月日","{0:yyyy年MM月dd日}") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="終了年月日" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_終了年月日" runat="server" Text='<%# Eval("終了年月日","{0:yyyy年MM月dd日}") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    <%--</ContentTemplate>
                </asp:UpdatePanel>
            </asp:Panel>--%>
        </div>
        <div class="detail-admin-row">
            <div class="btn_back">
                <asp:Button ID="btn_戻る" runat="server" Text="←戻る" OnClick="btn_戻る_Click"
                    CssClass="btn" CausesValidation="False" />
            </div>
            <div class="btn_next">
                <asp:Button ID="btn_次" runat="server" Text="次→" OnClick="btn_次_Click"
                    CssClass="btn" CausesValidation="False" />
            </div>
        </div>
        <div>
            &nbsp;</div>
        <asp:HiddenField ID="hfNgaySinh" runat="server" />
        <br />
    </div>
</asp:Content>
